# -*- coding: utf-8 -*-
"""
Created on Wed Aug 22 14:53:46 2018

@author: Who
"""

import time


def w_day(y, m, d):
    year = int(y)
    month = int(m)
    day = int(d)
    sum = day
    if year != 2018:
        sum = day + 365
    days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
    i = 0
    if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
        days[1] = 29
    while i < (month - 1):
        sum = sum + days[i]
        i += 1
    return sum


def count(date):
    future = list(map(int, date.split('-')))
    sum1 = w_day(future[0], future[1], future[2])
    return sum1


def day(date):
    dt = time.strftime("%Y-%m-%d", time.localtime())
    d1 = count(dt)
    d2 = count(date)
    return d1 - d2
